package com.sxhalo.fsms.service.impl;


import com.sxhalo.fsms.domain.DeviceDefectRecord;
import com.sxhalo.fsms.domain.RedisData;
import com.sxhalo.fsms.domain.TransducerRunningData;
import com.sxhalo.fsms.mapper.TransducerRunningDataMapper;
import com.sxhalo.fsms.service.ITransducerRunningDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class TransducerRunningDataServiceImpl implements ITransducerRunningDataService {

	@Autowired
	private TransducerRunningDataMapper mapper;

	@Override
	public Integer insertSelective(TransducerRunningData record) {
		return null;
	}

	@Override
	public Integer updateByPrimaryKeySelective(TransducerRunningData record) {
		return null;
	}

	@Override
	public Integer deleteByPrimaryKey(Object key) {
		return null;
	}

	@Override
	public TransducerRunningData selectByPrimaryKey(Object key) {
		return null;
	}

	@Override
	public List<TransducerRunningData> findWhereList(String where, String order) {
		return mapper.findWhereList(where, order);
	}

	@Override
	public Integer getCount(String where) {
		return mapper.getCount(where);
	}

	@Override
	public List<TransducerRunningData> findPagerList(Integer start, Integer length, String where, String order) {
		return mapper.findPagerList(start, length, where, order);
	}
	@Override
	public List<TransducerRunningData> findPhaseHis(String where) {
		return mapper.findPhaseHis(where);

	}

	@Override
	public Integer foreachInsert(List<RedisData> list) {
		if(list.size()==0){
			return null;
		}
		return mapper.batchInsert(list);

	}

	@Override
	public TransducerRunningData findLastData(Object deviceId) {
		return mapper.findLastData(Integer.parseInt(deviceId.toString()));
//		return null;
	}

	@Override
	public List<HashMap> findAttrHis(String attr, String where) {
		return mapper.findAttrHis(attr,where);
	}
}
